package com.sl.biz.modular.problem.controller;

import com.sl.biz.modular.problem.dao.domain.entity.ProblemDO;
import com.sl.biz.modular.problem.service.ProblemBizService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@RestController
@RequestMapping("/problem")
@RequiredArgsConstructor
public class ProblemController {

    private final ProblemBizService problemBizService;


    @PostMapping(value = "/list")
    public List<ProblemDO> list(@RequestBody ProblemDO problemDO) {
        return problemBizService.list(problemDO);
    }


    @PostMapping(value = "/save")
    public Boolean save(@RequestPart("param") ProblemDO problemDO, @RequestPart("file") MultipartFile file) {
        Boolean save = problemBizService.save(problemDO, file);
        return save;
    }

}
